package client.table;

import lovedna.events.Event;
import lovedna.resource.data.ResTable;
import common.table.Tables;

class TableMap extends Tables {
	private var onComplete:Void->Void;
    public function new() {
        super();
    }
	public function init(res:ResTable,onComplete:Void->Void):Void {
        this.onComplete=onComplete;
        res.addEventListener(Event.init.type,function (?e) {
           if(this.onComplete!=null){
               this.onComplete();
               this.onComplete=null;
           } 
        });
		var len:Int = _list.length;
		while (len-- > 0) {
			res.add(_list[len]);
		}
	}
}
